package org.sage.sdk.dada.order.entity;

import lombok.Data;
import org.sage.sdk.dada.infrastructure.common.BaseEntity;
import org.sage.sdk.dada.infrastructure.common.attributes.OrderId;
import org.sage.sdk.dada.infrastructure.common.attributes.ReasonId;
import org.sage.sdk.dada.infrastructure.utils.GetBodyUtil;

import javax.validation.constraints.NotNull;

/**
 * 商家投诉达达
 * <p>
 * 达达配送员接单后，商家如果对达达服务不满意，均可以使用该接口对达达进行投诉。
 * <p>
 * 接口调用请求说明，URL地址：/api/complaint/dada
 *
 * @author 周广明
 * @version v1 2019/12/10 下午7:28
 */
@Data
public class BusinessComplaintDada implements BaseEntity {

    @Override
    public String getUrl() {
        return "/api/complaint/dada";
    }

    @Override
    public String getBody() {
        return GetBodyUtil.toJsonStr(this);
    }

    public BusinessComplaintDada(OrderId orderId, ReasonId reasonId) {
        this.orderId = orderId;
        this.reasonId = reasonId;
    }

    @NotNull
    OrderId orderId;

    @NotNull
    ReasonId reasonId;
}
